Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement single session module #218

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mladenilic
Copy link
Contributor

This PR implements feature requested by #93 .

Module adds a new session_token field to the user model. Upon each successful login, new token value is generated. Token is then validated with the session token on each request.

One known issue is with the auto_login, similar to issues discussed in (#178). We will need to regenerate session token on auto_login as well. Currently not possible as there are no hooks available.

TO DO

  • Document new module in readme file
  • Add config documentation to the initializer
  • Add wiki guide

@joshbuker
Copy link
Member

Thanks @mladenilic! I'll take a look at this as soon as possible.

@joshbuker joshbuker self-requested a review December 30, 2019 22:43
@joshbuker joshbuker added the help wanted Community assistance requested label May 5, 2020
@joshbuker
Copy link
Member

If anyone in the community would really like to see this feature added to the next release, it would be very helpful to get some testing of this feature! Unfortunately I'm already neck-deep in work and personal projects, and don't really have the time to spare to do a thorough look at this PR.

@joshbuker
Copy link
Member

@Amialive So to get started with this one, you'll want to get a workspace ready first:

  • Fork the Sorcery repo
  • Clone your fork to your local machine
  • Add Sorcery/sorcery as a remote on your repo (git remote add upstream [email protected]:sorcery/sorcery.git)
  • Checkout the PR - See script below for example of how to do this.
# ~/.bash_aliases

git_pr() {
  if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then
    echo "Missing required arguments:"
    echo "1 - origin/upstream (remote where PR exists, not the fork)"
    echo "2 - pull request ID (e.g. '42' without quotation)"
    echo "3 - local branch to fetch onto (must not already exist)"
  else
    if git fetch $1 pull/$2/head:$3 ; then
      git checkout $3
    else
      echo "Failed to fetch pull request $2"
    fi
  fi
}

From there you should be able to start poking around the code.

@joshbuker
Copy link
Member

@Amialive if you get stuck or confused, please reach out and I will do what I can to help out.

@joshbuker
Copy link
Member

I ended up going with a slightly different methodology for enforcing single sign on in v1, which also better supports JWT revocation.

@joshbuker joshbuker added implemented in v1 This issue or pull request has been resolved in the v1 rework codebase and removed help wanted Community assistance requested labels Jun 5, 2021
@simonyang998
Copy link

simonyang998 commented Mar 18, 2022

I ended up going with a slightly different methodology for enforcing single sign on in v1, which also better supports JWT revocation.

when is V1 planned to be released? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented in v1 This issue or pull request has been resolved in the v1 rework codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants